<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jsp/base/taglibs.jsp"%>
<%@include file="/WEB-INF/jsp/base/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>修改餐厅</title>
</head>
<body>
	<s:form action="restaurantAction!restaurantEdit.do"
		namespace="/restaurant" name="form1" method="post">

		<input type="hidden" value="${restaurantBizBean.id }"
			name="restaurantBizBean.id" />
		<div class="edit-wapper">
			<label class="lab">餐厅类型：</label>
			<s:select list="codes" id="codes" listKey="code" listValue="text"
				name="restaurantBizBean.restaurantType"
				headerKey="%{restaurantBizBean.restaurantType}"></s:select>
		</div>
		<div class="edit-wapper">
			<label class="lab">名称：</label> <input type="text"
				name="restaurantBizBean.name" id="name" class="inputText"
				maxlength="30" value="${restaurantBizBean.name }"
				style="width: 450px" />
		</div>
		<div class="edit-wapper">
			<label class="lab">地址：</label> <input type="text"
				name="restaurantBizBean.address" id="address" class="inputText"
				maxlength="30" value="${restaurantBizBean.address}"
				style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['address'][0]}" /></label>
		</div>
		<div class="edit-wapper">
			<label class="lab">经度：</label> <input type="text"
				name="restaurantBizBean.longitude" id="codeName" class="inputText"
				maxlength="30" value="${restaurantBizBean.longitude}"
				style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['longitude'][0]}" /></label>
		</div>

		<div class="edit-wapper">
			<label class="lab">纬度：</label> <input type="text"
				name="restaurantBizBean.latitude" id="latitude" class="inputText"
				maxlength="30" value="${restaurantBizBean.latitude}"
				style="width: 450px;" /> <label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['latitude'][0]}" /></label>
		</div>
		<!-- 餐厅类型必须为：宴席 start -->
		<div id="feast_div"
			style="<c:if test="${restaurantBizBean.restaurantType=='FEAST'}">display: block;</c:if><c:if test="${restaurantBizBean.restaurantType!='FEAST'}">display:none;</c:if> ">
			<div class="edit-wapper">
				<label class="lab">宴席价格：</label> <input type="text"
					name="restaurantBizBean.feastPrice" id="feastPrice"
					class="inputText" maxlength="30"
					value="${restaurantBizBean.feastPrice}" style="width: 450px" /> <label
					class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['feastPrice'][0]}" /></label>
			</div>

			<div class="edit-wapper">
				<label class="lab">容纳桌席：</label> <input type="text"
					name="restaurantBizBean.accommodate" id="feastPrice"
					class="inputText" maxlength="30"
					value="${restaurantBizBean.accommodate}" style="width: 450px" /> <label
					class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['accommodate'][0]}" /></label>
			</div>
		</div>
		<div id="restaurant_div"
			style="<c:if test="${restaurantBizBean.restaurantType!='FEAST'}">display: block;</c:if><c:if test="${restaurantBizBean.restaurantType=='FEAST'}">display:none;</c:if> ">
			<div class="edit-wapper">
				<label class="lab">人均消费：</label> <input type="text"
					name="restaurantBizBean.averageConsumption" id="averageConsumption"
					maxlength="100" class="inputText"
					value="${restaurantBizBean.averageConsumption}"
					style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['averageConsumption'][0]}" /></label>
			</div>
		</div>
		<div class="edit-wapper">
			<label class="lab">订餐电话：</label> <input type="text"
				name="restaurantBizBean.TEL" id="TEL" maxlength="100"
				class="inputText" value="${restaurantBizBean.TEL}"
				style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['TEL'][0]}" /></label>
		</div>

		<div class="edit-wapper">
			<label class="lab">面积：</label> <input type="text"
				name="restaurantBizBean.useArea" id="useArea" maxlength="100"
				class="inputText" value="${restaurantBizBean.useArea}"
				style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['useArea'][0]}" /></label>
		</div>
		<div class="edit-wapper">
			<label class="lab">营业时间：</label> <input type="text"
				readonly="readonly" name="restaurantBizBean.businessHour"
				id="businessHour" maxlength="100" class="Wdate"
				value='<fmt:formatDate pattern="yyyy-MM-dd HH:mm" value="${restaurantBizBean.businessHour}"/>'
				style="width: 450px"
				onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" /> <label
				class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['businessHour'][0]}" /></label>
		</div>

		<div class="edit-wapper">
			<label class="lab">负责人：</label> <input type="text"
				name="restaurantBizBean.superintendent" id="superintendent"
				maxlength="100" class="inputText"
				value="${restaurantBizBean.superintendent}" style="width: 450px" />
			<label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['superintendent'][0]}" /></label>
		</div>

		<div class="edit-wapper">
			<label class="lab">是否可以刷卡：</label>
			<s:radio list="#{'true':'可以','false':'不可以'}"
				name="restaurantBizBean.creditCard"
				value="%{restaurantBizBean.creditCard}" />
			<label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['creditCard'][0]}" /></label>
		</div>

		<div class="edit-wapper">
			<label class="lab">WIFI：</label>
			<s:radio list="#{'true':'有','false':'没有'}"
				name="restaurantBizBean.WIFI" value="%{restaurantBizBean.WIFI}" />
			<label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['WIFI'][0]}" /></label>
		</div>

		<div class="edit-wapper">
			<label class="lab">餐厅简介：</label>
			<textarea name="restaurantBizBean.summary" id="summary" rows="5"
				maxlength="100" class="inputText" style="width: 450px">${restaurantBizBean.summary}</textarea>
			<label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['summary'][0]}" /></label>
		</div>
		<div class="edit-wapper">
			<label class="lab">停车情况：</label>
			<textarea name="restaurantBizBean.parkingInfo" id="parkingInfo"
				rows="5" maxlength="100" class="inputText" style="width: 450px">${restaurantBizBean.parkingInfo}</textarea>
			<label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['parkingInfo'][0]}" /></label>
		</div>
		<div class="edit-wapper">
			<label class="lab">公交信息：</label>
			<textarea name="restaurantBizBean.averageInfo" id="averageInfo"
				maxlength="100" rows="5" class="inputText" style="width: 450px">${restaurantBizBean.averageInfo}</textarea>
			<label class="error">*&nbsp;&nbsp;<s:property
					value="%{errors['averageInfo'][0]}" /></label>
		</div>

		<div class="btn-wapper">
			<s:submit cssClass="form-btn" value="修改" id="btnEnter" />
			<label class="error"><s:property
					value="%{errors['success'][0]}" /></label>
		</div>
	</s:form>
</body>
<script type="text/javascript">
	$(function() {
		$('select[id="codes"]').change(function() {
			if ($(this).val() == 'RESTAURANT') {
				$("#feast_div").hide();
				$("#restaurant_div").show();
			} else {
				$("#feast_div").show();
				$("#restaurant_div").hide();
			}
		});
	});
</script>
</html>